import urllib.request
# url='https://blog.csdn.net/qyj19920704/article/details/146564986'
url='https://blog.csdn.net/qyj19920704/article/details/146564986error'
headers={
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0'
}
try:
    request = urllib.request.Request(url, headers=headers)
    response = urllib.request.urlopen(request)
    print(response.read().decode('utf-8'))
except urllib.error.HTTPError as e:
    print('网址写错了喵~')

